<?php
namespace Common\Model;
use Common\Model\CommonModel;
class ZengsongModel extends CommonModel
{
	

	
	
	  
	  
	  
	  public  function get_guize(){
	  	$guize=C("SITE_CHONGZHI_ZENGSONG");

	  	$heng=explode("|",$guize);
	  	
	  	foreach ($heng as $k=>$v){
	  		$d=explode(",",$v);
	  		$s[]=array(
	  			"price"=>$d[0],
	  		"song"=>$d[1]
	  		 
	  		);
	  		
	  	
	  		
	  	}
	  	
	  	return $s;
	  }
	  
	  
	  public function  get_song($money){
	  	
	  	$guize= $this->get_guize();
	  	$retrun=0;
	  	
	  	
	  	foreach ($guize as $k=>$v){
	  		if($money>=$v["price"]){
	  			
	  			$retrun=$v["song"];
	  			
	  		}else
	  		{
	  			
	  			break;
	  		}
	  		
	  		
	  	}
	  	return $retrun;;
	  	
	  	
	  	
	  }
	

	
}

?>